package cn.dankal.flyaudio.personal.driverlisense

import api.UserServiceFactory
import cn.dankal.basiclib.base.fragment.BaseRecyclerViewFragment
import cn.dankal.basiclib.base.recyclerview.BaseRecyclerViewPresenter
import cn.dankal.basiclib.rx.AbstractStateSubscriber
import cn.dankal.business.pojo.BaseBeanList
import cn.dankal.business.pojo.LisenseBean

class LisensePresenter : BaseRecyclerViewPresenter<LisenseBean>() {
    override fun requestData(pageIndex: String?) {
        UserServiceFactory.vehicle_info_list(pageIndex, BaseRecyclerViewFragment.PAGE_SIZE)
                .subscribe(object : AbstractStateSubscriber<BaseBeanList<LisenseBean>>(view) {
                    override fun onNext(t: BaseBeanList<LisenseBean>) {
                        super.onNext(t)
                        this@LisensePresenter.view.render(t.list)
                    }
                })
    }
}